﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IssueIT.Core.Domain.Model;
using NUnit.Framework;

namespace IssueIT.Core.Tests.Domain
{
    [TestFixture]
    public class TagFixture
    {



        [Test]
        public void Issue_Tags_IsEmpty_OnNew_Issue()
        {
            Issue cut = new Issue(new Post());

            Assert.AreEqual(cut.Tags.Count, 0);
        }

        [Test]
        public void Issue_Tags_CanAdd_Tag()
        {
            Issue cut = new Issue(new Post());
            User poster = User.Unknown;

            Tag tag = new Tag(poster, "test");

            cut.Tags.Add(tag);

            Assert.AreEqual(cut.Tags.Count,1);
        }

        [Test]
        public void Issue_Tags_CantAdd_DublicatedTag()
        {
            Issue cut = new Issue(new Post());
            User poster = User.Unknown;

            Tag tag1 = new Tag(poster, "test");
            cut.Tags.Add(tag1);

            Tag tag2 = new Tag(poster, "TEST");
            cut.Tags.Add(tag2);

            Assert.AreEqual(cut.Tags.Count, 1);
        }
    }
}
